$(function ()
{
    // validate signup form on keyup and submit
    $("#userform").validate({
        rules : {
            username : {
                required : true,
                minlength : 2
            },
            password : {
                required : true,
                minlength : 5
            },
            repassword : {
                equalTo : "#password"
            }
        },
        messages : {
            username : {
                required : "用户名不能为空!",
                minlength : "奪"
            },
            password : {
                required : "密码不能为空!",
                minlength : "Your password must be at least 5 characters long"
            },
            repassword : {
                equalTo : "两次密码不一致"
            }
        }
    });

});